package com.lc.YYGH.hosp.controller.officeAdmin;

import com.lc.YYGH.common.result.Result;
import com.lc.YYGH.hosp.service.OfficeService;

import com.lc.YYGH.vo.office.LawOfficeQueryVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags="事务所管理接口")
@RestController
@RequestMapping("admin/hosp/office")
@CrossOrigin
public class OfficeAdminController {
    @Autowired
    private OfficeService officeService;
    @ApiOperation(value="获取分页列表")
    @PostMapping("{page}/{limit}")
    public Result index
            (
                    @ApiParam(name="page",value="当前页码",required = true)
                    @PathVariable Integer page,
                    @ApiParam(name="limit",value="每页记录数",required = true)
                    @PathVariable Integer limit,
                    @ApiParam(name="lawOfficeQueryVo",value="查询对象",required = false)
                    @RequestBody LawOfficeQueryVo lawOfficeQueryVo)
    {
        return Result.success(officeService.selectPage(page,limit,lawOfficeQueryVo));
    }


    @ApiOperation(value ="获取事务所详情" )
    @GetMapping("show/{id}")
    public Result show(
            @ApiParam(name="id",value="医院id",required = true)
            @PathVariable String id)
    {

        return Result.success(officeService.getDetail(id));
    }

}
